#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 10;
ll a[N], b[N];
ll highest_bit(ll x) {
	ll cnt = 0;
	while (x) {
		x >>= 1;
		cnt++;
	}
	return cnt;
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll t;
	cin >> t;
	while (t--) {
		ll n;
		cin >> n;
		memset(b, 0, sizeof(b));
		ll ans = 0;
		for (int i = 1; i <= n; i++) cin >> a[i];
		for (int i = 1; i <= n; i++) {
			b[highest_bit(a[i])]++;
			ans = max(ans, b[highest_bit(a[i])]);
		}
		cout << ans << '\n';
	}
	return 0;
}